package com.hw.webflux.router;

import com.hw.webflux.handler.UserHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;

import static org.springframework.web.reactive.function.server.RequestPredicates.GET;

/**
 * @program: spring-webflux
 * @description: webflux的Router写法
 * @author: hewei
 * @date: 2021-11-05 11:25
 **/
@Configuration
public class UserRouter {
//    @Bean
//    public RouterFunction<ServerResponse> userRoute(UserHandler handler) {
//        return RouterFunctions.nest(GET("/route"),
//                RouterFunctions.route(GET("/selectUserById"),handler::selectUserById)
//                        .andRoute(GET("/selectUserByAddr"),handler::selectUserByAddr)
//        );
//    }
}
